package cn.sc.allinpay.allfavour.module.printer;

/**
 * 打印管理器
 * author：pany
 * on 2017/11/9 10:20
 */
public class PrintManager {
    public static final int PRINT_DIST = 1;//发券
    public static final int PRINT_CHECK = 2;//验券
    public static final int PRINT_SALE = 3;//售券
    public static final int PRINT_CASHIER = 4;//收银小票摘要打印
    public static final int PRINT_CASHIER_FULL = 5;//收银小票摘要打印-全额抵扣支付
    public static final int PRINT_SETTLE = 9;//结算小票
    public static final int PRINT_OIL = 6;//线上加油

    public static IPrinter createPrinter(int type, PrintData printData) {
        IPrinter printer = null;
        switch (type) {
            case PRINT_DIST://发券
                printer = new DistCouponPrinter(printData);
                break;
            case PRINT_CHECK://验券
                printer = new CheckCouponPrinter(printData);
                break;
            case PRINT_SALE://售券
                printer = new SaleCouponPrinter(printData);
                break;
            case PRINT_CASHIER://收银小票摘要打印
                printer = new CashierPrinter(printData);
                break;
            case PRINT_CASHIER_FULL://收银小票摘要打印-全额抵扣支付
                printer = new CashierFullPrinter(printData);
                break;
            case PRINT_OIL://线上加油
                printer = new OilPrinter(printData);
                break;
            case PRINT_SETTLE:
                printer = new SettlePrinter(printData);//结算
                break;
        }
        return printer;
    }
}
